<?php
include "../../conn.php";

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>佳木斯优化发展环境综合评分系统</title>
<link href="css/dccss.css" rel="stylesheet" type="text/css" />

</head>
<body >
<div id="top">
  <div class="top"><img src="dcimages/index2.png" /></div>
</div>

<div id="left">
  <div class="menu menuic1">满意度统计</div>
  <ul class="menu1">
    <li><a href="pftj.php" class="menu1_icon1">评分统计</a></li>
    <li><a href="pjtj.php" class="menu1_icon2_on">评价统计</a></li>
    <li><a href="wttj.php" class="menu1_icon3">问题统计</a></li>
  </ul>
  <div class="menu menuic2">部门评比统计</div>
  <ul class="menu1">
    <li><a href="bmpftj.php" class="menu1_icon1">评分统计</a></li>
    <li><a href="bmpjtj.php" class="menu1_icon2">评价统计</a></li>
    <li><a href="bmwttj.php" class="menu1_icon3">问题统计</a></li>
  </ul>
</div>
<div id="main">
  <div class="content">
   <form method="get">
    <div class="pjtj">
      <span class="bj1"></span>
      <span class="bt">评价统计</span>
	  <span>
	 
        <select class="dwxz" name="bumeng">
		 <option value="">请选择部门</option>
		<?
		mysql_query("set names utf8");
		$sql1="select * from bumeng order by id asc";
		$query1=mysql_query($sql1);
		while($res1=mysql_fetch_array($query1)){
			
		?>
          <option value="<?=$res1['bmbh']?>"><?=$res1['bmname']?></option>
		  <?
		  }
		  ?>
        </select>
		<input type="submit" value="确定" name="tijiao"/>
      </span>
    </div>
	</form>
    <table cellpadding="0" cellspacing="0" width="100%" border="0" class="pjtj_con">
      <tr>
        <td width="75%" class="pjtj_zi1">评价内容</td>
        <td width="25%" class="pjtj_zi1">显示时间</td>
      </tr>
	  <?php
    mysql_query("set names utf8");
	$bumeng=$_GET["bumeng"];
	if($bumeng<>''){
		$bmcx=" and bmbh='".$bumeng."'";
	}
	$sql="select * from dcwj where pingjia <>'' ".$bmcx." order by id desc";
	//print_r($sql);
	$res=mysql_query($sql);
	if($res){
	$nums=mysql_num_rows($res); //取得总记录数
	$pagesize=7;//设定每页的记录数
	$pages=ceil($nums/$pagesize);//取得总页数
	if($pages<1){$pages=1;}//设定总页数至少1页
	$page=$_GET[page];//取得传递过来的页数
	if($page>$pages){$page=$pages;}//如果传递过来的页数比总页数还大，就让它等于总页数
	if($page<1){$page=1;}//如果传递过来的页数小于1，就让他等于1
	$kaishi=($page-1)*$pagesize;//为下一步做准备，limit的初始记录
	$asql=$sql . " limit $kaishi,$pagesize";//取得记录从计算出的初始值开始，一共$pagesize条
	$res2=mysql_query($asql);//取得结果
	while($arr=mysql_fetch_array($res2)){
	?>
	<tr>
        <td width="75%" align="left"><?=mb_substr($arr["pingjia"],0,200,'utf8')?></td>
        <td width="25%" class="pjtj_zi2"><?=$arr["logintime"]?></td>
      </tr>
	<?php
	}
	?>
    </table>
    <div id="page">
       <ul>
	     <li><a href="?bumeng=<?=$bumeng?>&page=&page=1" class="page1">首页</a></li>
         <li><a href="?bumeng=<?=$bumeng?>&page=<? echo $page-1;?>" class="page1">上一页</a></li>
         <li><a href="?bumeng=<?=$bumeng?>&page=<? echo $page+1;?>" class="page3">下一页&nbsp;</a></li>
		 <li><a href="?bumeng=<?=$bumeng?>&page=<? echo $pages;?>" class="page1">尾页</a></li>
         <li>总共<? echo $pages?>页 当前第<? echo $page;?>页</li>
       </ul>
	   <?
		}
		?>
    </div>
  </div>
</div>

<div id="bot1">
	技术支持：北京中农信达信息技术有限公司
</div>

</body>
</html>
